#include <stdio.h>
int main()
{	        		 
    int a[6], i, j, k, m;
    for (i = 0; i < 6; i++)
        scanf("%d", &a[i]);
    for (i = 5; i >= 0; i--)
    {	        		 
        for (m = 0; m < 6; m++)
            printf("%d ", a[m]);
        printf("\n");
        k = a[5];
        for (j = 5; j >= 1; j--)
            a[j] = a[j - 1];
        a[0] = k;
    }
    return 0;
}